﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/EditMaster.Master" AutoEventWireup="true"
    CodeBehind="EditUsers.aspx.cs" Inherits="BugSysSolution.DataManagement.EditUsers" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div>
        <table id="tab1" class="tab">
            <asp:Repeater ID="rep1" runat="server">
                <HeaderTemplate>
                    <tr>
                        <td>用户账号:</td>
                        <td>用户密码:</td>
                        <td>操作</td>
                    </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr>
                        <td><a href="#" target="_blank" tag='<%# Eval("id") %>' onclick="userinfo(this);"><%# Eval("uid") %></a></td>
                        <td><%# Eval("password") %></td>
                        <td><a id='<%# Eval("id") %>' onclick="Deluser(this);" href="#">Delete</a></td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
    </div>
    <script type="text/javascript">
        var requurl = "../RequestAjaxPage/UserAjaxPage.aspx";
        function Deluser(obj) {
            if (confirminfo("确认是否删除此用户?")) {
                var parm = {
                    tag: "del",
                    id: $(obj).attr("id")
                };
                SendAjax("post", requurl, parm, "", function (data) {
                    if (data == "Success") {
                        $(obj).parent().parent().remove();
                    }
                    else {
                        alert("请求服务器失败!");
                    }
                });
            }
        }

        function userinfo(obj) {
            window.location.href = "../UserInfo/MyInfo.aspx?id=" + $(obj).attr("tag");
        }
    </script>
</asp:Content>
